package com.eshop.product.mapper;

import com.eshop.product.model.Brand;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @ClassName CategoryMapper
 * @Description
 * @Author 47980
 * @Date 2020/5/17 16:08
 * @Version V_1.0
 **/
@Mapper
public interface BrandMapper {

    @Insert("INSERT INTO brand(name,description) VALUES(#{name},#{description})")
    public void add(Brand brand);

    @Update("UPDATE brand SET name=#{name},description=#{description} WHERE id=#{id}")
    public void update(Brand brand);

    @Delete("DELETE FROM brand WHERE id=#{id}")
    public void delete(Long id);

    @Select("SELECT * FROM brand where id=#{id}")
    public Brand findById(Long id);

    @Select("SELECT * FROM brand where id in (${ids})")
    public List<Brand> findByIds(@Param("ids") String ids);
}
